-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Robot Framework files with robotidy
#263
Conversation
apheleia-formatters.el
Outdated
@@ -136,6 +136,9 @@ | |||
"--parser=yaml" | |||
(apheleia-formatters-js-indent "--use-tabs" "--tab-width"))) | |||
(purs-tidy . ("apheleia-npx" "purs-tidy" "format")) | |||
(robotidy . ("robotidy" "--no-color" inplace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this triggers a bug somewhere, test suite or inplace
implementation, or my understanding of it?
Debugger entered--Lisp error: (error "Formatter robotidy modified original file in place")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch. This is probably a bug. It's the first time we've had a formatter actually use inplace 🙃. Could you open a new issue for this?
In the meantime I took a look at robotidy and it supports formatting to stdout. Generally this is the better choice because it side-steps the filesystem for subprocess io. You can change inplace to "-" and it should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #265 for the test suite issue.
Re stdout, nice catch! I couldn't find anything related to that in the docs, but now I see https://robotidy.readthedocs.io/en/stable/quickstart.html#transform-code-from-standard-input (that refers to stdin only though...). Anyway it seems to work indeed.
apheleia-formatters.el
Outdated
@@ -136,6 +136,9 @@ | |||
"--parser=yaml" | |||
(apheleia-formatters-js-indent "--use-tabs" "--tab-width"))) | |||
(purs-tidy . ("apheleia-npx" "purs-tidy" "format")) | |||
(robotidy . ("robotidy" "--no-color" inplace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch. This is probably a bug. It's the first time we've had a formatter actually use inplace 🙃. Could you open a new issue for this?
In the meantime I took a look at robotidy and it supports formatting to stdout. Generally this is the better choice because it side-steps the filesystem for subprocess io. You can change inplace to "-" and it should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
No description provided.